Imports System.Drawing
Imports System.Drawing.Drawing2D

Public Class TwoTriangleTile


    Private Sub TwoTriangleTile_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        Const iSide = 50
        Dim cx As Integer = Me.Width
        Dim cy As Integer = Me.Height

        'Ñònh nghóa tam giaùc cho choåi veõ thöù nhaát

        Dim apt As Point() = {New Point(0, 0), New Point(iSide, 0), New Point(0, iSide)}
        Dim pgbrush1 As New PathGradientBrush(apt, WrapMode.TileFlipXY)

        ' Ñònh nghóa tam giaùc cho choåi veõ thöù hai
          apt = new Point() {new Point(iSide, 0), new Point(iSide, iSide), new Point(0, iSide)}

Dim  pgbrush2 As new PathGradientBrush(apt, WrapMode.TileFlipXY)

        e.Graphics.FillRectangle(pgbrush1, 0, 0, cx, cy)
        e.Graphics.FillRectangle(pgbrush2, 0, 0, cx, cy)


    End Sub
End Class